package cn.myschool.web;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author oldliu
 * @since 1.0
 */
@ControllerAdvice
public class ExceptionController {
    @ExceptionHandler(NullPointerException.class)
    public String exec2(Exception e){
        e.printStackTrace();
        return "error";
    }
    @ExceptionHandler(Exception.class)
    public String exec(Exception e){
        e.printStackTrace();
        return "error";
    }
}
